<div class="modal-dialog">
    <div class="modal-content">
        <form role="form" action="{:U('goods/category_edit')}" method="post" id="addForm" enctype="multipart/form-data">
            <input type="hidden" name="id" value="{$id}">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">添加分类</h4>
            </div>
            <div class="modal-body">

                <div class="form-group">
                    <label for="name">分类名</label>
                    <input type="text" class="form-control" id="name" name="name" value="{$name}">
                </div>
                <div class="form-group">
                    <label for="pid">父分类</label>
                    <select name="pid" class="form-control">
                        <option value="0">主分类</option>
                        {$category_list}
                    </select>
                </div>
                <div class="form-group">
                    <label for="icon">分类ICON</label>
                    <input type="file" name="icon" class="form-control"/>
                    <notempty name="icon">
                    <img src="{$icon}" width="100" />
                    </notempty>
                </div>

                <div class="form-group">
                    <label for="sort">排序</label>
                    <input type="text" name="sort" class="form-control" value="{$sort}"/>
                </div>

                <div class="form-group">
                    <label for="status">状态</label>
                    <select name="status" class="form-control">
                        <option value="1" <eq name="sort" value="1">selected="selected"</eq> >可用</option>
                        <option value="0" <eq name="sort" value="0">selected="selected"</eq>>禁用</option>
                    </select>
                </div>
                <div class="form-group">
                    <label for="is_theme">主题馆</label>
                    <select name="is_theme" class="form-control">
                        <option value="1" <eq name="is_theme" value="1">selected="selected"</eq> >是</option>
                        <option value="0" <eq name="is_theme" value="0">selected="selected"</eq> >否</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="introduce">介绍</label>
                    <textarea name="introduce" class="form-control" rows="5" placeholder="对分类品牌的简要介绍">{$introduce}</textarea>
                </div>
            </div>
            <div class="modal-footer">
                <button type="submit" class="btn btn-danger">确认保存</button>
            </div>
        </form>
    </div>
    <script type="text/javascript">
        $("#addForm").bootstrapValidator({
            excluded: [':disabled'],
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            submitHandler: function (validator, form, submitButton) {
                validator.defaultSubmit();
            },
            fields: {
                name: {
                    validators: {
                        notEmpty: {
                            message: '分类名不能为空'
                        }
                    }
                }
            }
        });

    </script>
</div>